package com.cain.DontTapTheWhiteTile.tool;

/**
 * Created by Cain on 2016/6/16.
 * 用来处理所有有关字符串的操作
 */
public class MyString {

    private MyString() {

    }

    /**
     * 将计算好的时间转换成字符串
     * @param time
     * @return
     */
    public static String timeFormatToString(long[] time) {
        if (time[0] > 0) {
            return String.format("%d:%02d:%02d", time[0], time[1], time[2]);
        } else if (time[1] > 0) {
            return String.format("%02d:%02d.%02d''", time[1], time[2], time[3] / 10);
        } else {
            return String.format("%d.%03d''", time[2], time[3]);
        }
    }
}
